<template>
    <div>
        <el-form class="form-box" label-position="left">
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :lg="24">
                    <template>
                        <el-form-item class="form-item" label="外派部门：">
                            <el-cascader
                                style="width:80%"
                                    v-model="department"
                                    :options="departmentAllData"
                                    :props="{ checkStrictly: true }"
                                    filterable
                                    clearable></el-cascader>
                        </el-form-item>
                     </template>
                </el-col>
            </el-row>
        </el-form>
        <div class="form-btn">
            <el-button type="primary" @click="submitDispatch">保存</el-button>
        </div>
        
    </div>
    
</template>

<script>
import { getHeaderName } from '@/app.config'
export default {
    name: 'Talent',
    props: {
        departmentAllData: Array,
        employee_id: String
    },
    data() {
        return {
            itemData: {},
            department: '',
            departmentFilterData: []
        }
    },
    mounted() {
    },
    methods: {
        submitDispatch() {
            if(!this.department) {
                this.$message.warning("请选择外派部门")
                return false
            } else {
                let dept = this.department[this.department.length - 1]
                let data = {
                    dept_id: dept,
                    employee_id: this.employee_id
                }
                this.$emit('submitDispatch',data) 
            }
            
        }

    },
    watch: {

    }
}
</script>
<style lang="scss" scoped>
.form-box {
    padding: 0 20px 20px 20px;
}
.form-title {
    font-size: 18px;
    margin: 10px 0 30px 0;
}
.form-item {
    display: flex;
    min-height: 50px;
}
.form-btn {
    text-align: right;
}
</style>


